<template>
  <RenderTableColumn v-bind="columns" />
</template>

<script setup lang="tsx">
import type { RenderScope, TableProCloumn } from "@/typings";
defineProps<{ columns: TableProCloumn }>();

const RenderTableColumn = (item: TableProCloumn) => {
  item.fixed === "false" ? (item.fixed = false) : item.fixed;
  return (
    <el-table-column {...item}>
      {{
        default: (scope: RenderScope<any>) => {
          if (item._children && item._children.length > 0) return item._children.map((child) => RenderTableColumn(child));
          if (item.render) return item.render(scope);
        }
      }}
    </el-table-column>
  );
};
</script>

<style scoped lang=""></style>
